function foo(){
    var myname = "John";
    var age = 18;
    function bar(){
    console.log(myname);
    }
    bar()
}
foo()